<template>
    <div>
        <NCard>
            <NSpace vertical>
                <NSteps :current="current">
                    <NStep title="基础信息" />
                    <NStep title="测试数据上传" />
                </NSteps>
            </NSpace>
        </NCard>

        <NCard style="margin-top: 24px;">
            <BasicForm @next="next" v-show="current != 1" />
            <FileFrom @prev="prev" v-show="current === 1" />
        </NCard>
    </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import BasicForm from './BasicForm.vue';
import FileFrom from './FileFrom.vue'

const current = ref<number | null>(1);
const next = () => {
    if (current.value === null) current.value = 1
    else if (current.value >= 2) current.value = null
    else current.value++
}

const prev = () => {
    if (current.value === 0) current.value = null
    else if (current.value === null) current.value = 2
    else current.value--
}
</script>

<style scoped lang="less"></style>